{#<!DOCTYPE html>#}
{#<html lang="en">#}
{#<head>#}
{#    <meta charset="UTF-8">#}
{#    <title>Title</title>#}
{#</head>#}
{#<body>#}
{#dfgkljdfljgdfo;#}
{#{% for goods in page %}#}
{#    {{ goods.object.goods_name }}#}
{#{% endfor %}#}
{#</body>#}
{#</html>#}

{% extends "goods/base_goods.html" %}

{% block content %}
<div class="breadcrumb">
		<a href="#">全部分类</a>
		<span>&gt;</span>
		<a href="#">{{ category.category_name }}</a>
	</div>

    <div class="main_wrap clearfix">
		<div class="l_wrap fl clearfix">
			<div class="new_goods">
				<h3>新品推荐</h3>
				<ul>
                    {% for new in news %}
					<li>
						<a href="/goods/detail/{{ new.id }}/"><img src="{{ new.pic }}"></a>
						<h4><a href="/goods/detail/{{ new.id }}/">{{ new.goods_name }}</a></h4>
						<div class="prize">{{ new.price }}</div>
					</li>
					{% endfor %}
				</ul>
			</div>
		</div>

		<div class="r_wrap fr clearfix">
			<div class="sort_bar">
				<a href="/goods/list/{{ category.id }}/default/" {% if sort == "default" %}
                    class = "active"
                    {% endif %}>
                    默认</a>
				<a href="/goods/list/{{ category.id }}/price/"
                   {% if sort == "price" %}
                    class = "active"
                    {% endif %}
                >价格</a>
				<a href="/goods/list/{{ category.id }}/popular/"
                   {% if sort == "popular" %}
                    class = "active"
                    {% endif %}
                >人气</a>
			</div>

			<ul class="goods_type_list clearfix">
                {% for goods in page %}
                    <li>
					<a href="/goods/detail/{{ goods.object.id }}/"><img src="{{ goods.object.pic }}"></a>
					<h4><a href="/goods/detail/{{ goods.object.id }}/">{{ goods.object.goods_name }}</a></h4>
					<div class="operate">
						<span class="prize">{{ goods.object.price }}</span>
						<span class="unit">{{ goods.object.price }}/{{ goods.object.unit }}</span>
						<a href="/cart/" class="add_goods" title="加入购物车"></a>
					</div>
				</li>
                {% endfor %}

			</ul>

			<div class="pagenation">
                {% if page.has_previous %}
                    <a href="/goods/list/{{ category.id }}/{{ sort }}/{{ page.previous_page_number }}"><上一页</a>
                {% endif %}

				{% for num in page.paginator.page_range %}
                    {% if page_num == num %}
                        <a href="/goods/list/{{ category.id }}/{{ sort }}/{{ num }}/" class="active">{{ num }}</a>
                    {% else %}
                        <a href="/goods/list/{{ category.id }}/{{ sort }}/{{ num }}/" >{{ num }}</a>
                    {% endif %}

                {% endfor %}

             {% if page.has_next %}
                    <a href="/goods/list/{{ category.id }}/{{ sort }}/{{ page.next_page_number }}">上一页></a>
                {% endif %}
				<a href="#">下一页&gt;</a>
			</div>
		</div>
	</div>
{% endblock %}